﻿using System.Net.Security;
using System.Security.Cryptography.X509Certificates;

namespace Flowertwig.Utils.Entities.Security
{
    public class CertificateValidationInfo
    {
        protected X509Certificate _cert;
        protected X509Chain _chain;
        protected SslPolicyErrors _errors = SslPolicyErrors.None;
        protected bool _acc;

        public X509Certificate Certificate
        {
            get { return _cert; }
            set { _cert = value; }
        }

        public X509Chain Chain
        {
            get { return _chain; }
            set { _chain = value; }
        }

        public SslPolicyErrors PolicyErrors
        {
            get { return _errors; }
            set { _errors = value; }
        }

        public bool Accepted
        {
            get { return _acc; }
            set { _acc = value; }
        }

        public CertificateValidationInfo(X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
        {
            _cert = certificate;
            _chain = chain;
            _errors = sslPolicyErrors;
        }
    }
}
